<?php session_start();
	include("../service/loginService.php");
	$username = $_POST['username'];
	$password = md5($_POST['password']);
	if (authenticate($username, $password) == true) {
		$_SESSION['user'] = $username;
		header("Location: ../admin-page/index.php");
	} else {
		header("Location: ../admin-page/login.php?login=fail");
	}
?>
